<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <title><g:message code="activity.edit" default="Edit Activity"/></title>
    <resource:dateChooser/>
  </head>
  <body>
    <div class="nav">
      %{--<span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>--}%
      <span class="menuButton"><g:link class="list" action="list"><g:message code="activity.list" default="Activity List"/></g:link></span>
      <span class="menuButton"><g:link class="create" action="create"><g:message code="activity.new" default="New Activity"/></g:link></span>
    </div>
    <div class="body">
      <h1><g:message code="activity.edit" default="Edit Activity"/></h1>
      <g:if test="${flash.message}">
        <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}"/></div>
      </g:if>
      <g:hasErrors bean="${activityInstance}">
        <div class="errors">
          <g:renderErrors bean="${activityInstance}" as="list"/>
        </div>
      </g:hasErrors>
      <g:form method="post">
        <g:hiddenField name="id" value="${activityInstance?.id}"/>
        <g:hiddenField name="version" value="${activityInstance?.version}"/>
        <div class="dialog">
          <table>
            <tbody>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="team"><g:message code="activity.team" default="Team"/>:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'team', 'errors')}">
                  <g:hiddenField name="team.id" value="${activityInstance.team?.id}"/>
                  ${activityInstance.team}
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="activityTime"><g:message code="activity.activityTime" default="Activity Time"/>:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'activityTime', 'errors')}">
                  <richui:dateChooser name="activityTime" format="yyyy-MM-dd" value="${activityInstance?.activityTime}" time="true"/>
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="actualPersonCount"><g:message code="activity.actualPersonCount" default="Actual Person Count"/>:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'actualPersonCount', 'errors')}">
                  <input type="text" id="actualPersonCount" name="actualPersonCount" value="${fieldValue(bean: activityInstance, field: 'actualPersonCount')}"/>
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="description"><g:message code="activity.description" default="Description"/>:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'description', 'errors')}">
                  <g:textArea name="description" value="${fieldValue(bean: activityInstance, field: 'description')}" rows="5" cols="100"/>
                </td>
              </tr>

            </tbody>
          </table>
        </div>
        <div class="buttons">
          <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'button.update', 'default': 'Update')}"/></span>
        </div>
      </g:form>
    </div>
  </body>
</html>
